From: Matthias Clasen Date: Wed, 12 Oct 2022 03:32:35 +0000 (-0400) Subject: filesystemmodel: Fix a possible problem X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~143^2~20 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3a2ce620e23096447b228bc5d0d7bc9291c57e25;p=gtk4.git filesystemmodel: Fix a possible problem If the async query fails to reproduce a file info, we still need to thaw the model, otherwise it ends up frozen forever. This was deduced by reading the code, I haven't actually seen it happen. --- diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index 87cd5d4ca0..d937f23f29 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -607,22 +607,19 @@ query_done_helper (GObject * object, gpointer data, gboolean do_thaw_updates) { - GtkFileSystemModel *model; + GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (data); GFile *file = G_FILE (object); GFileInfo *info; info = g_file_query_info_finish (file, res, NULL); - if (info == NULL) - return; - - model = GTK_FILE_SYSTEM_MODEL (data); - - _gtk_file_system_model_update_file (model, file, info); + if (info) + { + _gtk_file_system_model_update_file (model, file, info); + g_object_unref (info); + } if (do_thaw_updates) thaw_updates (model); - - g_object_unref (info); } static void